/**
 * 
 */
package entity;

import java.math.BigDecimal;
import java.util.Date;

import utils.StatusType;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

/**
 * @author Hung
 *
 */
@DatabaseTable(tableName="Plan")
public class Plan {
	
	@DatabaseField(generatedId=true)
	private int id;
	
	@DatabaseField
	private Date beginDate;
	
	@DatabaseField
	private Date endDate;
	
	@DatabaseField
	private BigDecimal amount;
	
	@DatabaseField(canBeNull=false, foreign=true, defaultValue="1")
	private Account account;
	
	@DatabaseField
	private StatusType status;
	
	Plan() {
		
	}
	
	public Plan(Date beginDate, Date endDate, BigDecimal amount, Account account) {
		this.beginDate = beginDate;
		this.endDate = endDate;
		this.amount = amount;
		this.account = account;
		this.status = StatusType.UNDONE;
	}
	
	public Account getAccount() {
		return account;
	}
	public void setAccount(Account account) {
		this.account = account;
	}
	public int getId() {
		return id;
	}
	public Date getBeginDate() {
		return beginDate;
	}
	public void setBeginDate(Date beginDate) {
		this.beginDate = beginDate;
	}
	public Date getEndDate() {
		return endDate;
	}
	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}
	public BigDecimal getAmount() {
		return amount;
	}
	public void setAmount(BigDecimal amount) {
		this.amount = amount;
	}
	public StatusType getStatus() {
		return status;
	}
	public void setStatus(StatusType status) {
		this.status = status;
	}
	
	
	
}
